package com.xsky.dataGrid
{
	import flash.display.DisplayObject;
	
	import mx.core.Application;
	import mx.managers.PopUpManager;
	
	public class DataProxy
	{
		public function DataProxy()
		{
		}
		public function addData(tableName:String,parent:DisplayObject):void
		{
			if(tableName=="tabUser")
			{
				mx.core.Application.application.components["addUserWindow"].x = (mx.core.Application.application.width-mx.core.Application.application.components["addUserWindow"].width)/2;
				mx.core.Application.application.components["addUserWindow"].y = (mx.core.Application.application.height-mx.core.Application.application.components["addUserWindow"].height)/2;
				mx.core.Application.application.components["addUserWindow"].creationCompleteHandle();
				PopUpManager.addPopUp(mx.core.Application.application.components["addUserWindow"],parent,true);
			}
			else if(tableName=="gkdhbl")
			{
				mx.core.Application.application.components["recordPhone"].x = (mx.core.Application.application.width-mx.core.Application.application.components["recordPhone"].width)/2;
				mx.core.Application.application.components["recordPhone"].y = (mx.core.Application.application.height-mx.core.Application.application.components["recordPhone"].height)/2;
				mx.core.Application.application.components["recordPhone"].creationCompleteHandle();
				PopUpManager.addPopUp(mx.core.Application.application.components["recordPhone"],parent,true);
			}
			else if(tableName=="affiche")
			{
				mx.core.Application.application.components["addAfficheWin"].x = (mx.core.Application.application.width-mx.core.Application.application.components["addAfficheWin"].width)/2;
				mx.core.Application.application.components["addAfficheWin"].y = (mx.core.Application.application.height-mx.core.Application.application.components["addAfficheWin"].height)/2;
				mx.core.Application.application.components["addAfficheWin"].creationCompleteHandle();
				PopUpManager.addPopUp(mx.core.Application.application.components["addAfficheWin"],parent,true);
			}
			else if(tableName=="infoman")
			{
				mx.core.Application.application.components["addInfoManWin"].x = (mx.core.Application.application.width-mx.core.Application.application.components["addInfoManWin"].width)/2;
				mx.core.Application.application.components["addInfoManWin"].y = (mx.core.Application.application.height-mx.core.Application.application.components["addInfoManWin"].height)/2;
				mx.core.Application.application.components["addInfoManWin"].creationCompleteHandle();
				PopUpManager.addPopUp(mx.core.Application.application.components["addInfoManWin"],parent,true);
			}
			else if(tableName=="infile")
			{
				mx.core.Application.application.components["infileRecord"].x = (mx.core.Application.application.width-mx.core.Application.application.components["infileRecord"].width)/2;
				mx.core.Application.application.components["infileRecord"].y = 100;
				mx.core.Application.application.components["infileRecord"].creationCompleteHandle();
				PopUpManager.addPopUp(mx.core.Application.application.components["infileRecord"],parent,true);
			}
			else if(tableName=="gzap")
			{
				mx.core.Application.application.components["addGzapWin"].x = (mx.core.Application.application.width-mx.core.Application.application.components["addGzapWin"].width)/2;
				mx.core.Application.application.components["addGzapWin"].y = 100;
				mx.core.Application.application.components["addGzapWin"].creationCompleteHandle();
				PopUpManager.addPopUp(mx.core.Application.application.components["addGzapWin"],parent,true);
			}
			else if(tableName=="underTask")
			{
				mx.core.Application.application.components["addTaskWin"].x = (mx.core.Application.application.width-mx.core.Application.application.components["addTaskWin"].width)/2;
				mx.core.Application.application.components["addTaskWin"].y = 100;
				PopUpManager.addPopUp(mx.core.Application.application.components["addTaskWin"],parent,true);
			}
		}
		public function showItemInfo(tableName:String,infoXml:XML,parent:DisplayObject):void
		{
			if(tableName=="bsxx")
			{
				mx.core.Application.application.components["editBsxx"].x = (mx.core.Application.application.width-mx.core.Application.application.components[tableName].width)/2;
				mx.core.Application.application.components["editBsxx"].y = (mx.core.Application.application.height-mx.core.Application.application.components[tableName].height)/2;
				mx.core.Application.application.components["editBsxx"].creationCompleteHandle();
				PopUpManager.addPopUp(mx.core.Application.application.components["editBsxx"],parent,true);
				mx.core.Application.application.components["editBsxx"].infoXml = infoXml;
			}
			else if(tableName=="infile")
			{
				mx.core.Application.application.components["infileDetailWin"].x = (mx.core.Application.application.width-mx.core.Application.application.components["infileDetailWin"].width)/2;
				mx.core.Application.application.components["infileDetailWin"].y = 100;
				mx.core.Application.application.components["infileDetailWin"].infoXml = infoXml;
				mx.core.Application.application.components["infileDetailWin"].creationCompleteHandle();
				PopUpManager.addPopUp(mx.core.Application.application.components["infileDetailWin"],parent,true);
			}
			else if(tableName=="gzap")
			{
				mx.core.Application.application.components["gzapDetailWin"].x = (mx.core.Application.application.width-mx.core.Application.application.components["gzapDetailWin"].width)/2;
				mx.core.Application.application.components["gzapDetailWin"].y = 100;
				mx.core.Application.application.components["gzapDetailWin"].infoXml = infoXml;
				mx.core.Application.application.components["gzapDetailWin"].creationCompleteHandle();
				PopUpManager.addPopUp(mx.core.Application.application.components["gzapDetailWin"],parent,true);
			}
			else if(tableName=="underTask")
			{
				mx.core.Application.application.components["taskDetailWin"].x = (mx.core.Application.application.width-mx.core.Application.application.components["taskDetailWin"].width)/2;
				mx.core.Application.application.components["taskDetailWin"].y = 100;
				mx.core.Application.application.components["taskDetailWin"].infomation = infoXml;
				mx.core.Application.application.components["taskDetailWin"].creationCompleteHandle();
				PopUpManager.addPopUp(mx.core.Application.application.components["taskDetailWin"],parent,true);
			}
		}
	}
}